ff796e1ca2fc582e0d123f38b8fe425030394753,uportal-war/src/main/java/org/jasig/portal/layout/dlm/remoting/UpdatePreferencesServlet.java,UpdatePreferencesServlet,moveElementInternal,#HttpServletRequest#String#String#String#,1258

Before Change


          } else {
              String siblingId = isInsert ? destinationId : null;

              if (!ulm.moveNode(sourceId, ulm.getParentId(destinationId), siblingId)) {
                  log.info("moveNode returned false for sourceId={}, destinationId={}, method={};  "
                          + "Aborting node movement", sourceId, destinationId, method);
                  return false;

After Change


      UserPreferencesManager upm = (UserPreferencesManager) ui.getPreferencesManager();
      IUserLayoutManager ulm = upm.getUserLayoutManager();

      boolean success = false;
      if (isTab(ulm, destinationId)) {
          // If the target is a tab type node, move the element to the end of the first column.
          // TODO Try to insert it into the first available column if multiple columns
          Enumeration<String> columns = ulm.getChildIds(destinationId);
          if (columns.hasMoreElements()) {
              success = attemptNodeMove(ulm, sourceId, columns.nextElement(), null);
          } else {
              // Attempt to create a new column

              IUserLayoutFolderDescription newColumn = new UserLayoutFolderDescription();
              newColumn.setName("Column");
              newColumn.setId("tbd");
              newColumn.setFolderType(IUserLayoutFolderDescription.REGULAR_TYPE);
              newColumn.setHidden(false);
              newColumn.setUnremovable(false);
              newColumn.setImmutable(false);

              // add the column to our layout
              IUserLayoutNodeDescription col = ulm.addNode(newColumn, destinationId, null);

              // If column was created (might not if the tab had addChild=false), move the channel.
              if (col != null) {
                  success = attemptNodeMove(ulm, sourceId, col.getId(), null);
              } else {
                  log.info("Unable to move item into existing columns on tab {} and unable to create new column",
                          destinationId);
              }
          }

      } else {
          // If destination is a column, attempt to move into end of column
          if (isFolder(ulm, destinationId)) {
              success = attemptNodeMove(ulm, sourceId, destinationId, null);
          } else {
              // If insertBefore move to prior to node else to end of folder containing node
              success = attemptNodeMove(ulm, sourceId, ulm.getParentId(destinationId),
                      "insertBefore".equals(method) ? destinationId : null);
          }
      }

      try {
          if (success) {
              ulm.saveUserLayout();
          }
      } catch (PortalException e) {